package com.winspread.app.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.winspread.app.R
import com.winspread.app.databinding.FragmentBBinding
import com.winspread.mvvm.base.vm.BaseNotFragment

/**
 *Author: Amin
 *Data: 2022/4/13 16:30
 *
 *Description:
 *
 */
class BFragment : BaseNotFragment<FragmentBBinding>(R.layout.fragment_b) {

    companion object {
        fun getInstance(bundle: (() -> Bundle)?): BFragment {
            val bFragment = BFragment()
            bFragment.arguments = bundle?.invoke()
            return bFragment
        }
    }

    override fun initView() {
        binding.fragmentTop1.fmTemp = childFragmentManager
        binding.fragmentTop1.fragments = linkedMapOf(
            Pair(
                R.id.but_1,
                AFragment.getInstance {
                    val bundle = Bundle()
                    bundle.putString("AFRAGMENT", "AFRAGMENT_3_1")
                    return@getInstance bundle
                },
            ),
            Pair(
                R.id.but_2,
                AFragment.getInstance {
                    val bundle = Bundle()
                    bundle.putString("AFRAGMENT", "AFRAGMENT_3_2")
                    return@getInstance bundle
                },
            ),

            )
    }


}